<?php

namespace Liuhelong\LaravelAdmin\Wechat\Actions\WechatOffiaccountMenu;

use Encore\Admin\Actions\Action;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;

class Download extends Action
{
    public $name = '重载菜单栏';

    protected $selector = '.download';
	
	public function dialog()
    {
        $this->confirm('确定重载菜单栏？会清空本地未发布的更改');
    }
	
    public function handle(Request $request)
    {
        Cache::forget('menus');

		return $this->response()->success('重载成功！')->refresh();
    }
	
	
    public function html()
    {
        return <<<HTML
        <a class="btn btn-sm btn-warning download" style="margin-right:10px;"><i class="fa fa-download"></i>重载菜单栏</a>
HTML;
    }
}